<<<<<<< .mine
%% Identification
% David Krause
% Movember 2012
% March 2, 2012
%
%% Code
% Query ADC and set motor

%% Clean up
clc
close all
clear all
drawnow
a = instrfind()
if ~isempty(a)
    fclose(a)
    clear a
end

s = serial('COM20', 'Baudrate', 115200);
fopen(s)
s
return

%%
N_capture = 128;
N_adc = 6;
a = zeros(N_capture, N_adc);

start_clock = clock;

for count = 1 : N_capture
    a(count, :) = get_adc_vec(s);
%     disp(['Capture ' num2str(count) ' of ' num2str(N_capture)]);
    if mod(count, 64) == 1
        disp(['Count ' num2str(count) ' of ' num2str(N_capture)]);
%     pause(0.25);    
    end
end

stop_clock = clock;

etime(stop_clock, start_clock)

% fclose(s)

% adc
% pwm 1 0 10
% pwm 


figure;
image(a);

%% Work with the motor
set_pwm = 20;
for count = 1 : 32
    set_motor_pwm(s, 1, set_pwm + count, 1, set_pwm + round(count / 2));
    pause(0.05)
end
set_motor_pwm(s, 1, 0, 1, 0);=======
%% Identification
% David Krause
% Movember 2012
% March 2, 2012
%
%% Code
% Query ADC and set motor

%% Clean up
clc
close all
clear all
drawnow
a = instrfind()
if ~isempty(a)
    fclose(a)
    clear a
end

s = serial('COM20', 'Baudrate', 115200);
fopen(s)
s
return

%%
N_capture = 1024;
N_adc = 6;
a = zeros(N_capture, N_adc);

start_clock = clock;

for count = 1 : N_capture
    a(count, :) = get_adc_vec(s);
%     disp(['Capture ' num2str(count) ' of ' num2str(N_capture)]);
    if mod(count, 64) == 1
        disp(['Count ' num2str(count) ' of ' num2str(N_capture)]);
%     pause(0.25);    
    end
end

stop_clock = clock;

% fclose(s)

% adc
% pwm 1 0 10
% pwm 
>>>>>>> .r329
